package com.chocus.controller;

import com.chocus.entity.Employee;
import com.chocus.service.EmployeeService;
import com.chocus.util.LoggerHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 〈一句话功能简述〉<br>
 * 〈员工控制器〉
 *
 * @author chocus
 * @create 2018/5/14
 * @since 1.0.0
 */
@RestController
@RequestMapping("/emp")
public class EmployeeController implements LoggerHelper {

    @Autowired
    private EmployeeService employeeService;

    @RequestMapping("/{id}")
    public Employee getEmp(@PathVariable("id") Integer id) {
        return employeeService.getEmp(id);
    }

    @RequestMapping("/update")
    public Employee updateEmp(Employee employee) {
        return employeeService.updateEmp(employee);
    }

    @RequestMapping("/del")
    public void delEmp(Integer id) {
        employeeService.delEmp(id);
    }
}